<!DOCTYPE html>
<html lang="en">
<head>

    <meta charset="UTF-8">
    <title>load 事件 :页面加载完成后再执行</title>
    <script>
        function f() {
            var ele=document.getElementsByClassName('div1')[0];
            console.log(ele.innerHTML);
//            ele.style.css("color",'red')
        }

    </script>
</head>
<body onload="f()">
<div class="div1">hello div</div>



</body>
</html>